package com.hdax.dm.rest;

import com.hdax.dm.base.DmArea;
import com.hdax.dm.base.Image;
import com.hdax.dm.common.api.ImageControllerApi;
import com.hdax.dm.item.ItemType;
import com.hdax.dm.service.AreaService;
import com.hdax.dm.service.ImageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Service
public class ImageRestService implements ImageControllerApi {

    @Autowired
    private ImageService imageService;

    @Autowired
    private AreaService areaService;

    public Image image(@RequestParam("targetId")Long targetId,
                       @RequestParam("type")Long type,
                       @RequestParam("category")Long category){
        return imageService.image(targetId, type, category);
    }

    @Override
    public List<DmArea> dmArea() {
        return areaService.area();
    }


}

